package slim3.controller.admin;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import org.slim3.util.BeanUtil;

import slim3.meta.PostMeta;
import slim3.model.Post;
import slim3.service.PostService;

public class EditController extends Controller {

    private PostService service = new PostService();

    private PostMeta meta = PostMeta.get();
    
    @Override
    public Navigation run() throws Exception {
        Post post = service.get(asKey(meta.key), asLong(meta.version));
        BeanUtil.copy(post, request);
        return forward("/admin/Edit.jsp");
    }
}
